package com.chuangjiangx.member.coupon.ddd.domain.model;

/**
 * Created by Lenovo on 2018/9/7.
 */
public enum WxCardStatus {
    CARD_STATUS_NOT_VERIFY("待审核","CARD_STATUS_NOT_VERIFY"),
    CARD_STATUS_VERIFY_FAIL("审核失败","CARD_STATUS_VERIFY_FAIL"),
    CARD_STATUS_VERIFY_OK ("通过审核","CARD_STATUS_VERIFY_OK"),
    CARD_STATUS_USER_DELETE ("卡券被商户删除","CARD_STATUS_USER_DELETE"),
    CARD_STATUS_DISPATCH ("在公众平台投放过的卡券","CARD_STATUS_DISPATCH");

    public final String name;
    public final String code;

    WxCardStatus(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public static WxCardStatus get(String code){
        for(WxCardStatus type : values()){
            if(type.code.equals(code)){
                return type;
            }
        }
        return null;
    }
}
